<template>
  <div>
    <h1>{{count}}</h1>
    <button @click='countHandle(num)'>点击</button>
  </div>
</template>

<script>
export default {
    name:'Count',
    props:['num'],
    data(){
        return{
            count:0
        }
    },
    methods:{
        countHandle(num){
            this.count+=num
        }
    }
}
</script>

<style>

</style>